package com.songyz.image.compress.dto;

public class NotifyDTO {

    private String type;// success/warning/info/error
    private String title;
    private String message;
    private boolean finished;

    public NotifyDTO() {
    }

    public NotifyDTO(String type, String title, String message) {
        this.type = type;
        this.title = title;
        this.message = message;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static NotifyDTO success(String message) {
        return success("成功", message);
    }

    public static NotifyDTO success(String title, String message) {
        return new NotifyDTO("success", title, message);
    }

    public static NotifyDTO info(String message) {
        return info("消息", message);
    }

    public static NotifyDTO info(String title, String message) {
        return new NotifyDTO("info", title, message);
    }

    public static NotifyDTO warning(String message) {
        return warning("警告", message);
    }

    public static NotifyDTO warning(String title, String message) {
        return new NotifyDTO("warning", title, message);
    }

    public static NotifyDTO error(String message) {
        return error("异常", message);
    }

    public static NotifyDTO error(String title, String message) {
        return new NotifyDTO("error", title, message);
    }

    public boolean isFinished() {
        return finished;
    }

    public void setFinished(boolean finished) {
        this.finished = finished;
    }

}
